package com.music.controller.tag;

import com.music.controller.music.PlaylistController;
import com.music.dto.music.PlaylistDTO;
import com.music.dto.system.TokenDTO;
import com.music.dto.utils.OpResultDTO;
import com.music.service.music.PlaylistService;
import com.music.service.tag.TagService;
import com.music.utils.JWTUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@RestController
@RequestMapping("/api/tag")
public class TagController {
    @Resource
    private TagService tagService;
    private final Logger logger = LoggerFactory.getLogger(TagController.class);

    /**
     * @Description: 查询所有二级标签
     * @Author dy
     * @Date 2021/11/25
     */
    @RequestMapping(value = "/listAllTag", method = RequestMethod.POST)
    public OpResultDTO listAllTag() {
        OpResultDTO opResult = new OpResultDTO();
        try {
            opResult.setMessage("success");
            opResult.setResult(tagService.listAllTag());
        } catch (Exception e) {
            logger.error(e.toString());
            opResult.setMessage("error");
        }
        return opResult;
    }
}
